//
//  main.c
//  模拟实现strcat
//
//  Created by 卜绎皓 on 2022/3/26.
//

#include<stdio.h>
#include<assert.h>
char* my_strcat(char*arr1, const char*arr2)
{
    assert(arr1 != NULL);
    assert(arr1 != NULL);
    while (*arr1 != '\0')
    {
        arr1++;
    }
        while (*arr2 != '\0')
        {
            *arr1 = *arr2;
            arr1++;
            arr2++;
        }
    return arr1;
}
int main()
{
    char arr1[20] = "hello";
    char* arr2 = " bit";
    my_strcat(arr1, arr2);
    printf("%s",arr1);
    return 0;
}

